package com.huang.exception;

import com.huang.resp.CommonResult;
import lombok.Getter;

/**
 * @author han
 * @since 2022-02-18 09:31:18
 */
public class BizException extends RuntimeException {
    private static final long serialVersionUID = -8210352842750354279L;

    @Getter
    private final Integer code;

    @Getter
    private final String msg;

    /**
     * 自定义异常
     *
     * @param commonResult 返回枚举对象
     */
    public BizException(CommonResult commonResult) {
        super(commonResult.getMsg());
        this.code = commonResult.getCode();
        this.msg = commonResult.getMsg();
    }


}
